clc;clear;close all;
%% 生成图片
group = 5;
F = 6;
A = 0.4;
B = 0.38;
freq = 64;
I_row = 1140;
I_col = 912;
%设置参数矩阵
% 一行代表一组的参数
% 每一行有5列，分别为：谐波B1, 噪声强度, 噪声均值, 非线性, 相移倾斜程度
param = zeros(group,5);
phase_shift = pi*[0 0.01 0.03 0.04 0.06 0.07];
for g =1:group
    param(g,:) = [0, 0, 0, 1, (g-1)/30];
end

I1 = zeros(I_row,I_col,3);I2 = I1;
for g = 1 : group
    filepath = ['.\Figure\',int2str(g)];
    ps = phase_shift;
    B1 = param(g,1);
    ni = param(g,2);
    nm = param(g,3);
    gamma = param(g,4);
    pst = param(g,5);
    Figure = fun_createFigure(F, A, B, B1, freq, I_row, I_col, ...
                ni, nm, gamma,...
                ps, pst, filepath);
    I1(:,:,1) = Figure{1,1};I1(:,:,2) = Figure{2,1};I1(:,:,3) = Figure{3,1};
    imwrite(I1,[filepath,'-I1.bmp']);fprintf('------%s条纹图生成！------ \n', [filepath,'-I1.bmp']);
    I2(:,:,1) = Figure{4,1};I2(:,:,2) = Figure{5,1};I2(:,:,3) = Figure{6,1};
    imwrite(I2,[filepath,'-I2.bmp']);fprintf('------%s条纹图生成！------ \n', [filepath,'-I2.bmp']);
end
